<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <?php echo $html->charset(); ?>
  <title><?php __($currentCity); __(' Classifield Ads'); e(' | '); __($title_for_layout); ?></title>
<?php
  echo $html->meta('icon');
  echo $html->css('reset');
  echo $html->css('grid');
  echo $html->css('type');
  echo $html->css('style');
  echo $html->css('template');
  if (is_array($javascripts)) {
     foreach ($javascripts as $js) {
        echo $javascript->link($js);
     }
  }
  echo $scripts_for_layout;
?>
<script type="text/javascript" charset="utf-8">
    var mesg = {
        onSaving: '<?php __('Saving..'); ?>',
        onFail: '<?php __('Fail making page request!'); ?>',
        onSuccess: '<?php __('Form data saved!'); ?>',
        invalid: '<?php __('Please enter the requested details in the fields pointed out below and try again!'); ?>'
    };
    var path = '<?php e($this->base); ?>';

    if (typeof Prototype != 'undefined') {
        document.observe("dom:loaded", function() { // initial any javascript at here
<?php if ($user_role == 'admin') { ?>
            if ($('logo')) {
                $('logo').observe('mouseover', function(){
                    $('changeLogo').removeClassName('hide');
                });
                $('logo').observe('mouseout', function(){
                    $('changeLogo').addClassName('hide');
                });
            }
<?php } ?>
        });
    }
</script>
</head>
<body>

<div class="rel" style="z-index:2;">
  <div class="abs" style="width:100%;">
    <div style="width:100%; margin:0 auto;">
      <div id="loginpanel" class="center" style="display:none;">
<?php echo $form->create('User', array('url'=>'/users/login')); ?>
        <div class="dr hand" style="margin-right:5px;" onclick="loginPanel()"><?php __('Close Panel'); ?></div>
        <div style="padding:10px 0 5px 0;">
          <?php __('Email:'); ?> <?php echo $form->input('User.email', array('label'=>false, 'div'=>false)); ?>
          <?php __('Password:'); ?> <input type="password" id="UserPassword" name="data[User][password]" value="" />
          <input type="submit" value="<?php __('Sign In'); ?>" />
        </div>
        <span style="padding-right:30px;"><input type="checkbox" id="remeberme" /><?php __('Remember me'); ?></span>
        <?php __('Not a member?'); ?>
        <?php echo $html->link(__('Register', true), '/users/register'); ?> |
        <?php echo $html->link(__('Lost your password?', true), '/users/forgot'); ?>
<?php echo $form->end(); ?>
      </div>


    </div>
  </div>
</div>

  <div id="container" class="main" style="width:950px">

    <div id="header" class="hp">
      <div id="logo" title="<?php __($sitename); ?>" class="dl rel"
       style="width:300px; height:110px; background-image:url(<?php e($this->requestAction('/cmsImages/get/logo.png')); ?>);">
        <div id="changeLogo" onclick="imageUploader.open('logo','<?php e($this->base); ?>');" class="hide"><?php __('Change Logo'); ?></div>
      </div>

      <div id="menubar_core">

        <div id="menubar_aux" class="dr" style="padding:6px 8px 4px 8px;">
<?php if (empty($myname)) { ?>
        <?php echo $html->link(__('Register', true), '/users/register'); ?> |
        <span class="link" onclick="loginPanel()"><?php __('Sign In'); ?></span>
<?php } else { ?>
        <?php echo $html->link(__('Hi ',true).$myname, '/users/home'); ?> |
        <?php echo $html->link(__('Sign Out',true), '/users/logout'); ?>
<?php } ?>
        </div>
        <div class="dr" style="margin-top:20px">
          <div style="margin:0 auto; width:550px;">
            <div class="dl links"><?php echo $html->link(__('Home',true), '/'); ?></div>
            <div class="dl split"></div>
	    <div class="dl links"><?php echo $html->link(__('Categories',true), '/adCategories'); ?></div>
            <div class="dl split"></div>
            <div class="dl links"><?php echo $html->link(__('Post Ad',true), '/adCategories/selectCategory'); ?></div>
            <div class="dl split"></div>
            <div class="dl links"><?php echo $html->link(__('My Account',true), '/users/home'); ?></div>
            <div class="dl split"></div>
            <div class="dl links"><?php echo $html->link(__('Help',true), '/pages/help'); ?></div>
          </div>
        </div>
        <div class="clear"></div>
      </div>

    </div>

<div id="menubar_search" class="hp header" style="vertical-align:middle">

<div style="text-align:left; clear:both; top:8px; position:relative" class="dl">
<script type="text/javascript">
<!--
google_ad_client    = '<?php e($adsenseId); ?>';
google_ad_channel   = '9829121152';
google_ad_width     = 468;
google_ad_height    = 15;
google_ad_format    = '468x15_0ads_al_s';
google_color_border = '000000';
google_color_bg     = '000000';
google_color_link   = 'FFFFFF';
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>

        <div class="dr" style="margin-right:10px; margin-top:3px">
          <span style="padding-right:5px"><strong>Quick Search:</strong> </span>
		  <input type="text" id="main_search" value="<?php isset($keywords)?e($keywords):''; ?>" />
<?php echo $this->element('categories', array('cache'=>true)); ?>
          <input type="button" value="<?php __('Search'); ?>" style="height:25px" />
		</div>
</div>

<div id="content" class="hp" style="padding-top:20px">
<?php if (isset($currentCity)) { ?>
    <div id="menubar_location" class="clear dl40" style="margin-left:57px">
        <h1 style="display:inline; color:#BD070F;"><?php __($currentCity); ?></h1>
        <a href="<?php e($this->base.'/locations/all'); ?>" class="bold" style="color:#222;"><?php __('Change City'); ?></a>
    </div>
<?php } ?>
      <div id="innerContent" class="clear" style="margin:15px 10px 10px 10px;">
<?php if ($session->check('Message.flash') || $session->check('Message.auth')) { ?>
        <div id="messageBox" style="margin-bottom:5px;"><?php $session->flash().$session->flash('auth'); ?></div>
        <div class="clear"></div>
<?php } else if ($session->check('Message.email')) { ?>
        <div id="messageBox" style="margin-bottom:5px;"><?php $session->flash('email'); ?></div>
        <div class="clear"></div>
<?php } ?>
        <div id="page_content">
          <div class="clear"></div>
          <table>
            <tr>
              <td></td>
              <td style="width:100%;">
                <div id="banner"></div>
                <?php echo $content_for_layout; ?>
              </td>
              <td>
                <div id="elements" class="dr" style="width:230px; display:none;">
                  side modules
                </div>
              </td>
            </tr>
          </table>
        </div>
      </div>

<div style="padding-bottom:15px"><center>
<script type="text/javascript"><!--
google_ad_client = "<?php e($adsenseId); ?>";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "image";
google_ad_channel = "9829121152";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FFFFFF";
google_color_text = "FFFFFF";
google_color_url = "FFFFFF";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center></div>


    </div>

    <div id="footer" class="hp" style="padding-bottom:10px">
<?php if (isset($areas) && count($areas) > 0) { ?>
      <div id="footer_cities" style="margin: 15px 0 5px 10px">
        <?php __('Other Areas:'); ?>
<?php     foreach ($areas as $id=>$area) { ?>
        <a href="<?php e($this->base); ?>/locations/city/<?php e($id); ?>"><?php __($area); ?></a>
<?php     } ?>
      </div>
<?php } ?>
<?php if (!empty($countries) && count($countries) > 0) { ?>
      <div id="footer_countries" style="margin: 0 10px 10px 10px; padding-bottom:10px; border-bottom:1px solid #555555">
        <?php __('Other countries/regions:'); ?>
<?php     foreach ($countries as $country) { ?>
        <a href="<?php e($this->base); ?>/locations/country/<?php e(low($country)); ?>/<?php e($id); ?>"><?php __($country); ?></a>
<?php     } ?>
      </div>
<?php } ?>
      <div id="footer_links" style="margin-left:8px; margin-right:8px; padding-top:5px">
        <?php echo $html->link(__('Help', true), '/pages/help'); ?> |&nbsp;&nbsp;&nbsp;
        <?php echo $html->link(__('Privacy Policy', true), '/pages/policy'); ?> |&nbsp;&nbsp;&nbsp;
        <?php echo $html->link(__('Terms of Use', true), '/pages/terms'); ?> |&nbsp;&nbsp;&nbsp;
        <?php echo $html->link(__('Contact Us', true), '/pages/contact'); ?>
      </div>
      <div id="copyright" style="margin-left:10px"><?php __('copyright'); ?> <?php echo $html->link('&copy;','/admin/pages/cpanel',array('style'=>'color:#CCCCCC;background-color:transparent;'),false,false); ?> <?php e(date('Y')); ?> <?php __($sitename); ?></div>
      <div class="clear"></div>
    </div>
  </div>
  <div style="color:#ccc;">
    <?php echo $cakeDebug; ?>
  </div>

</body>
</html>
